﻿using System;
using System.Data;
using System.Text;
using System.Collections.Generic;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using System.Data.Common;

namespace Chenxin.Lib.Business.DAL
{
    /// <summary>
    /// 数据访问类t_Contract_ApplyInfo。
    /// </summary>
    public class ContractApplyInfo
    {
        public ContractApplyInfo()
        { }
        #region  成员方法


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static void Add(Chenxin.Lib.Business.Entity.ContractApplyInfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into t_Contract_ApplyInfo(");
            strSql.Append("RecordId,BusinessType,BargainType,BargainPrice,ConfirmType,HouseId,HouseCode,HouseAddress,HouseProperty,Area,CompleteYear,Fitment,CommunityId,Community,CommunityAddress,PropertyCode,Region,Block,CurrentFloor,TotalFloor,BuildingType,HouseUse,HouseType,BargainCityId,BargainCityName,BargainCompanyId,BargainCompanyName,BargainDepartmentId,BargainDepartmentName,BargainUserId,BargainUserName,VenderCityId,VenderCityName,VenderCompanyId,VenderCompanyName,VenderDepartId,VenderDepartName,VenderUserId,VenderUserName,VenderId,VenderName,VenderNo,VenderPhone,VenderMobile,BuyerCityId,BuyerCityName,BuyerCompanyId,BuyerCompanyName,BuyerDepartId,BuyerDepartName,BuyerUserId,BuyerUserName,BuyerId,BuyerName,BuyerNo,BuyerPhone,BuyerMobile,VStandardCommision,BStandardCommision,VRealCommision,BRealCommision,VCommision,BCommision,VConsulting,BConsulting,Status,CreateCityId,CreateCityName,CreateCompanyId,CreateCompanyName,CreateDepartmentId,CreateDepartmentName,CreateUserId,CreateUserName,CreateTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,BusinessDescribe,ApplicationDay,DoneDay,BudinessCode,PointRemark,CustomerSource,FixDiscount)");

            strSql.Append(" values (");
            strSql.Append("@RecordId,@BusinessType,@BargainType,@BargainPrice,@ConfirmType,@HouseId,@HouseCode,@HouseAddress,@HouseProperty,@Area,@CompleteYear,@Fitment,@CommunityId,@Community,@CommunityAddress,@PropertyCode,@Region,@Block,@CurrentFloor,@TotalFloor,@BuildingType,@HouseUse,@HouseType,@BargainCityId,@BargainCityName,@BargainCompanyId,@BargainCompanyName,@BargainDepartmentId,@BargainDepartmentName,@BargainUserId,@BargainUserName,@VenderCityId,@VenderCityName,@VenderCompanyId,@VenderCompanyName,@VenderDepartId,@VenderDepartName,@VenderUserId,@VenderUserName,@VenderId,@VenderName,@VenderNo,@VenderPhone,@VenderMobile,@BuyerCityId,@BuyerCityName,@BuyerCompanyId,@BuyerCompanyName,@BuyerDepartId,@BuyerDepartName,@BuyerUserId,@BuyerUserName,@BuyerId,@BuyerName,@BuyerNo,@BuyerPhone,@BuyerMobile,@VStandardCommision,@BStandardCommision,@VRealCommision,@BRealCommision,@VCommision,@BCommision,@VConsulting,@BConsulting,@Status,@CreateCityId,@CreateCityName,@CreateCompanyId,@CreateCompanyName,@CreateDepartmentId,@CreateDepartmentName,@CreateUserId,@CreateUserName,@CreateTime,@UpdateCityId,@UpdateCityName,@UpdateCompanyId,@UpdateCompanyName,@UpdateDepartmentId,@UpdateDepartmentName,@UpdateUserId,@UpdateUserName,@UpdateTime,@BusinessDescribe,@ApplicationDay,@DoneDay,@BudinessCode,@PointRemark,@CustomerSource,@FixDiscount)");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "RecordId", DbType.Guid, model.RecordId);
            db.AddInParameter(dbCommand, "BusinessType", DbType.Int32, model.BusinessType);
            db.AddInParameter(dbCommand, "BargainType", DbType.Int32, model.BargainType);
            db.AddInParameter(dbCommand, "BargainPrice", DbType.Currency, model.BargainPrice);
            db.AddInParameter(dbCommand, "ConfirmType", DbType.Int32, model.ConfirmType);
            db.AddInParameter(dbCommand, "HouseId", DbType.Guid, model.HouseId);
            db.AddInParameter(dbCommand, "HouseCode", DbType.AnsiString, model.HouseCode);
            db.AddInParameter(dbCommand, "HouseAddress", DbType.AnsiString, model.HouseAddress);
            db.AddInParameter(dbCommand, "HouseProperty", DbType.Int32, model.HouseProperty);
            db.AddInParameter(dbCommand, "Area", DbType.Decimal, model.Area);
            db.AddInParameter(dbCommand, "CommunityId", DbType.Guid, model.CommunityId);
            db.AddInParameter(dbCommand, "Community", DbType.AnsiString, model.Community);
            db.AddInParameter(dbCommand, "CommunityAddress", DbType.AnsiString, model.CommunityAddress);
            db.AddInParameter(dbCommand, "PropertyCode", DbType.AnsiString, model.PropertyCode);
            db.AddInParameter(dbCommand, "Region", DbType.AnsiString, model.Region);
            db.AddInParameter(dbCommand, "Block", DbType.AnsiString, model.Block);
            db.AddInParameter(dbCommand, "CurrentFloor", DbType.Int32, model.CurrentFloor);
            db.AddInParameter(dbCommand, "TotalFloor", DbType.Int32, model.TotalFloor);
            db.AddInParameter(dbCommand, "BuildingType", DbType.AnsiString, model.BuildingType);
            db.AddInParameter(dbCommand, "HouseUse", DbType.AnsiString, model.HouseUse);
            db.AddInParameter(dbCommand, "HouseType", DbType.AnsiString, model.HouseType);
            db.AddInParameter(dbCommand, "BargainCityId", DbType.Guid, model.BargainCityId);
            db.AddInParameter(dbCommand, "BargainCityName", DbType.AnsiString, model.BargainCityName);
            db.AddInParameter(dbCommand, "BargainCompanyId", DbType.Guid, model.BargainCompanyId);
            db.AddInParameter(dbCommand, "BargainCompanyName", DbType.AnsiString, model.BargainCompanyName);
            db.AddInParameter(dbCommand, "BargainDepartmentId", DbType.Guid, model.BargainDepartmentId);
            db.AddInParameter(dbCommand, "BargainDepartmentName", DbType.AnsiString, model.BargainDepartmentName);
            db.AddInParameter(dbCommand, "BargainUserId", DbType.Guid, model.BargainUserId);
            db.AddInParameter(dbCommand, "BargainUserName", DbType.AnsiString, model.BargainUserName);
            db.AddInParameter(dbCommand, "VenderCityId", DbType.Guid, model.VenderCityId);
            db.AddInParameter(dbCommand, "VenderCityName", DbType.AnsiString, model.VenderCityName);
            db.AddInParameter(dbCommand, "VenderCompanyId", DbType.Guid, model.VenderCompanyId);
            db.AddInParameter(dbCommand, "VenderCompanyName", DbType.AnsiString, model.VenderCompanyName);
            db.AddInParameter(dbCommand, "VenderDepartId", DbType.Guid, model.VenderDepartId);
            db.AddInParameter(dbCommand, "VenderDepartName", DbType.AnsiString, model.VenderDepartName);
            db.AddInParameter(dbCommand, "VenderUserId", DbType.Guid, model.VenderUserId);
            db.AddInParameter(dbCommand, "VenderUserName", DbType.AnsiString, model.VenderUserName);
            db.AddInParameter(dbCommand, "VenderId", DbType.Guid, model.VenderId);
            db.AddInParameter(dbCommand, "VenderName", DbType.AnsiString, model.VenderName);
            db.AddInParameter(dbCommand, "VenderNo", DbType.AnsiString, model.VenderNo);
            db.AddInParameter(dbCommand, "VenderPhone", DbType.AnsiString, model.VenderPhone);
            db.AddInParameter(dbCommand, "VenderMobile", DbType.AnsiString, model.VenderMobile);
            db.AddInParameter(dbCommand, "BuyerCityId", DbType.Guid, model.BuyerCityId);
            db.AddInParameter(dbCommand, "BuyerCityName", DbType.AnsiString, model.BuyerCityName);
            db.AddInParameter(dbCommand, "BuyerCompanyId", DbType.Guid, model.BuyerCompanyId);
            db.AddInParameter(dbCommand, "BuyerCompanyName", DbType.AnsiString, model.BuyerCompanyName);
            db.AddInParameter(dbCommand, "BuyerDepartId", DbType.Guid, model.BuyerDepartId);
            db.AddInParameter(dbCommand, "BuyerDepartName", DbType.AnsiString, model.BuyerDepartName);
            db.AddInParameter(dbCommand, "BuyerUserId", DbType.Guid, model.BuyerUserId);
            db.AddInParameter(dbCommand, "BuyerUserName", DbType.AnsiString, model.BuyerUserName);
            db.AddInParameter(dbCommand, "BuyerId", DbType.Guid, model.BuyerId);
            db.AddInParameter(dbCommand, "BuyerName", DbType.AnsiString, model.BuyerName);
            db.AddInParameter(dbCommand, "BuyerNo", DbType.AnsiString, model.BuyerNo);
            db.AddInParameter(dbCommand, "BuyerPhone", DbType.AnsiString, model.BuyerPhone);
            db.AddInParameter(dbCommand, "BuyerMobile", DbType.AnsiString, model.BuyerMobile);
            db.AddInParameter(dbCommand, "VStandardCommision", DbType.Currency, model.VStandardCommision);
            db.AddInParameter(dbCommand, "BStandardCommision", DbType.Currency, model.BStandardCommision);
            db.AddInParameter(dbCommand, "VRealCommision", DbType.Currency, model.VRealCommision);
            db.AddInParameter(dbCommand, "BRealCommision", DbType.Currency, model.BRealCommision);
            db.AddInParameter(dbCommand, "VCommision", DbType.Currency, model.VCommision);
            db.AddInParameter(dbCommand, "BCommision", DbType.Currency, model.BCommision);
            db.AddInParameter(dbCommand, "VConsulting", DbType.Currency, model.VConsulting);
            db.AddInParameter(dbCommand, "BConsulting", DbType.Currency, model.BConsulting);
            db.AddInParameter(dbCommand, "Status", DbType.Int32, model.Status);
            db.AddInParameter(dbCommand, "CreateCityId", DbType.Guid, model.CreateCityId);
            db.AddInParameter(dbCommand, "CreateCityName", DbType.AnsiString, model.CreateCityName);
            db.AddInParameter(dbCommand, "CreateCompanyId", DbType.Guid, model.CreateCompanyId);
            db.AddInParameter(dbCommand, "CreateCompanyName", DbType.AnsiString, model.CreateCompanyName);
            db.AddInParameter(dbCommand, "CreateDepartmentId", DbType.Guid, model.CreateDepartmentId);
            db.AddInParameter(dbCommand, "CreateDepartmentName", DbType.AnsiString, model.CreateDepartmentName);
            db.AddInParameter(dbCommand, "CreateUserId", DbType.Guid, model.CreateUserId);
            db.AddInParameter(dbCommand, "CreateUserName", DbType.AnsiString, model.CreateUserName);
            db.AddInParameter(dbCommand, "CreateTime", DbType.DateTime, model.CreateTime);
            db.AddInParameter(dbCommand, "UpdateCityId", DbType.Guid, model.UpdateCityId);
            db.AddInParameter(dbCommand, "UpdateCityName", DbType.AnsiString, model.UpdateCityName);
            db.AddInParameter(dbCommand, "UpdateCompanyId", DbType.Guid, model.UpdateCompanyId);
            db.AddInParameter(dbCommand, "UpdateCompanyName", DbType.AnsiString, model.UpdateCompanyName);
            db.AddInParameter(dbCommand, "UpdateDepartmentId", DbType.Guid, model.UpdateDepartmentId);
            db.AddInParameter(dbCommand, "UpdateDepartmentName", DbType.AnsiString, model.UpdateDepartmentName);
            db.AddInParameter(dbCommand, "UpdateUserId", DbType.Guid, model.UpdateUserId);
            db.AddInParameter(dbCommand, "UpdateUserName", DbType.AnsiString, model.UpdateUserName);
            db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime);
            db.AddInParameter(dbCommand, "BusinessDescribe", DbType.AnsiString, model.BusinessDescribe);
            db.AddInParameter(dbCommand, "ApplicationDay", DbType.DateTime, model.ApplicationDay);
            db.AddInParameter(dbCommand, "DoneDay", DbType.DateTime, model.DoneDay);
            db.AddInParameter(dbCommand, "BudinessCode", DbType.AnsiString, model.BudinessCode);
            db.AddInParameter(dbCommand, "PointRemark", DbType.AnsiString, model.PointRemark);
            db.AddInParameter(dbCommand, "CompleteYear", DbType.AnsiString, model.CompleteYear);
            db.AddInParameter(dbCommand, "Fitment", DbType.AnsiString, model.Fitment);
            db.AddInParameter(dbCommand, "CustomerSource", DbType.AnsiString, model.CustomerSource);
            db.AddInParameter(dbCommand, "FixDiscount", DbType.Currency, model.FixDiscount);            
            db.ExecuteNonQuery(dbCommand);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static void Update(Chenxin.Lib.Business.Entity.ContractApplyInfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update t_Contract_ApplyInfo set ");
            strSql.Append("BusinessType=@BusinessType,");
            strSql.Append("BargainType=@BargainType,");
            strSql.Append("BargainPrice=@BargainPrice,");
            strSql.Append("ConfirmType=@ConfirmType,");
            strSql.Append("HouseId=@HouseId,");
            strSql.Append("HouseCode=@HouseCode,");
            strSql.Append("HouseAddress=@HouseAddress,");
            strSql.Append("HouseProperty=@HouseProperty,");
            strSql.Append("Area=@Area,");
            strSql.Append("CompleteYear=@CompleteYear,");
            strSql.Append("Fitment=@Fitment,");
            strSql.Append("CommunityId=@CommunityId,");
            strSql.Append("Community=@Community,");
            strSql.Append("CommunityAddress=@CommunityAddress,");
            strSql.Append("PropertyCode=@PropertyCode,");
            strSql.Append("Region=@Region,");
            strSql.Append("Block=@Block,");
            strSql.Append("CurrentFloor=@CurrentFloor,");
            strSql.Append("TotalFloor=@TotalFloor,");
            strSql.Append("BuildingType=@BuildingType,");
            strSql.Append("HouseUse=@HouseUse,");
            strSql.Append("HouseType=@HouseType,");
            strSql.Append("BargainCityId=@BargainCityId,");
            strSql.Append("BargainCityName=@BargainCityName,");
            strSql.Append("BargainCompanyId=@BargainCompanyId,");
            strSql.Append("BargainCompanyName=@BargainCompanyName,");
            strSql.Append("BargainDepartmentId=@BargainDepartmentId,");
            strSql.Append("BargainDepartmentName=@BargainDepartmentName,");
            strSql.Append("BargainUserId=@BargainUserId,");
            strSql.Append("BargainUserName=@BargainUserName,");
            strSql.Append("VenderCityId=@VenderCityId,");
            strSql.Append("VenderCityName=@VenderCityName,");
            strSql.Append("VenderCompanyId=@VenderCompanyId,");
            strSql.Append("VenderCompanyName=@VenderCompanyName,");
            strSql.Append("VenderDepartId=@VenderDepartId,");
            strSql.Append("VenderDepartName=@VenderDepartName,");
            strSql.Append("VenderUserId=@VenderUserId,");
            strSql.Append("VenderUserName=@VenderUserName,");
            strSql.Append("VenderId=@VenderId,");
            strSql.Append("VenderName=@VenderName,");
            strSql.Append("VenderNo=@VenderNo,");
            strSql.Append("VenderPhone=@VenderPhone,");
            strSql.Append("VenderMobile=@VenderMobile,");
            strSql.Append("BuyerCityId=@BuyerCityId,");
            strSql.Append("BuyerCityName=@BuyerCityName,");
            strSql.Append("BuyerCompanyId=@BuyerCompanyId,");
            strSql.Append("BuyerCompanyName=@BuyerCompanyName,");
            strSql.Append("BuyerDepartId=@BuyerDepartId,");
            strSql.Append("BuyerDepartName=@BuyerDepartName,");
            strSql.Append("BuyerUserId=@BuyerUserId,");
            strSql.Append("BuyerUserName=@BuyerUserName,");
            strSql.Append("BuyerId=@BuyerId,");
            strSql.Append("BuyerName=@BuyerName,");
            strSql.Append("BuyerNo=@BuyerNo,");
            strSql.Append("BuyerPhone=@BuyerPhone,");
            strSql.Append("BuyerMobile=@BuyerMobile,");
            strSql.Append("VStandardCommision=@VStandardCommision,");
            strSql.Append("BStandardCommision=@BStandardCommision,");
            strSql.Append("VRealCommision=@VRealCommision,");
            strSql.Append("BRealCommision=@BRealCommision,");
            strSql.Append("VCommision=@VCommision,");
            strSql.Append("BCommision=@BCommision,");
            strSql.Append("VConsulting=@VConsulting,");
            strSql.Append("BConsulting=@BConsulting,");
            strSql.Append("Status=@Status,");
            strSql.Append("CreateCityId=@CreateCityId,");
            strSql.Append("CreateCityName=@CreateCityName,");
            strSql.Append("CreateCompanyId=@CreateCompanyId,");
            strSql.Append("CreateCompanyName=@CreateCompanyName,");
            strSql.Append("CreateDepartmentId=@CreateDepartmentId,");
            strSql.Append("CreateDepartmentName=@CreateDepartmentName,");
            strSql.Append("CreateUserId=@CreateUserId,");
            strSql.Append("CreateUserName=@CreateUserName,");
            strSql.Append("CreateTime=@CreateTime,");
            strSql.Append("UpdateCityId=@UpdateCityId,");
            strSql.Append("UpdateCityName=@UpdateCityName,");
            strSql.Append("UpdateCompanyId=@UpdateCompanyId,");
            strSql.Append("UpdateCompanyName=@UpdateCompanyName,");
            strSql.Append("UpdateDepartmentId=@UpdateDepartmentId,");
            strSql.Append("UpdateDepartmentName=@UpdateDepartmentName,");
            strSql.Append("UpdateUserId=@UpdateUserId,");
            strSql.Append("UpdateUserName=@UpdateUserName,");
            strSql.Append("UpdateTime=@UpdateTime,");
            strSql.Append("BusinessDescribe=@BusinessDescribe,");
            strSql.Append("ApplicationDay=@ApplicationDay,");
            strSql.Append("DoneDay=@DoneDay,");
            strSql.Append("BudinessCode=@BudinessCode,");
            strSql.Append("PointRemark=@PointRemark,");
            strSql.Append("CustomerSource=@CustomerSource,");
            strSql.Append("FixDiscount=@FixDiscount");
            strSql.Append(" where RecordId=@RecordId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "RecordId", DbType.Guid, model.RecordId);
            db.AddInParameter(dbCommand, "BusinessType", DbType.Int32, model.BusinessType);
            db.AddInParameter(dbCommand, "BargainType", DbType.Int32, model.BargainType);
            db.AddInParameter(dbCommand, "BargainPrice", DbType.Currency, model.BargainPrice);
            db.AddInParameter(dbCommand, "ConfirmType", DbType.Int32, model.ConfirmType);
            db.AddInParameter(dbCommand, "HouseId", DbType.Guid, model.HouseId);
            db.AddInParameter(dbCommand, "HouseCode", DbType.AnsiString, model.HouseCode);
            db.AddInParameter(dbCommand, "HouseAddress", DbType.AnsiString, model.HouseAddress);
            db.AddInParameter(dbCommand, "HouseProperty", DbType.AnsiString, model.HouseProperty);
            db.AddInParameter(dbCommand, "Area", DbType.Decimal, model.Area);
            db.AddInParameter(dbCommand, "CommunityId", DbType.Guid, model.CommunityId);
            db.AddInParameter(dbCommand, "Community", DbType.AnsiString, model.Community);
            db.AddInParameter(dbCommand, "CommunityAddress", DbType.AnsiString, model.CommunityAddress);
            db.AddInParameter(dbCommand, "PropertyCode", DbType.AnsiString, model.PropertyCode);
            db.AddInParameter(dbCommand, "Region", DbType.AnsiString, model.Region);
            db.AddInParameter(dbCommand, "Block", DbType.AnsiString, model.Block);
            db.AddInParameter(dbCommand, "CurrentFloor", DbType.Int32, model.CurrentFloor);
            db.AddInParameter(dbCommand, "TotalFloor", DbType.Int32, model.TotalFloor);
            db.AddInParameter(dbCommand, "BuildingType", DbType.AnsiString, model.BuildingType);
            db.AddInParameter(dbCommand, "HouseUse", DbType.AnsiString, model.HouseUse);
            db.AddInParameter(dbCommand, "HouseType", DbType.AnsiString, model.HouseType);
            db.AddInParameter(dbCommand, "BargainCityId", DbType.Guid, model.BargainCityId);
            db.AddInParameter(dbCommand, "BargainCityName", DbType.AnsiString, model.BargainCityName);
            db.AddInParameter(dbCommand, "BargainCompanyId", DbType.Guid, model.BargainCompanyId);
            db.AddInParameter(dbCommand, "BargainCompanyName", DbType.AnsiString, model.BargainCompanyName);
            db.AddInParameter(dbCommand, "BargainDepartmentId", DbType.Guid, model.BargainDepartmentId);
            db.AddInParameter(dbCommand, "BargainDepartmentName", DbType.AnsiString, model.BargainDepartmentName);
            db.AddInParameter(dbCommand, "BargainUserId", DbType.Guid, model.BargainUserId);
            db.AddInParameter(dbCommand, "BargainUserName", DbType.AnsiString, model.BargainUserName);
            db.AddInParameter(dbCommand, "VenderCityId", DbType.Guid, model.VenderCityId);
            db.AddInParameter(dbCommand, "VenderCityName", DbType.AnsiString, model.VenderCityName);
            db.AddInParameter(dbCommand, "VenderCompanyId", DbType.Guid, model.VenderCompanyId);
            db.AddInParameter(dbCommand, "VenderCompanyName", DbType.AnsiString, model.VenderCompanyName);
            db.AddInParameter(dbCommand, "VenderDepartId", DbType.Guid, model.VenderDepartId);
            db.AddInParameter(dbCommand, "VenderDepartName", DbType.AnsiString, model.VenderDepartName);
            db.AddInParameter(dbCommand, "VenderUserId", DbType.Guid, model.VenderUserId);
            db.AddInParameter(dbCommand, "VenderUserName", DbType.AnsiString, model.VenderUserName);
            db.AddInParameter(dbCommand, "VenderId", DbType.Guid, model.VenderId);
            db.AddInParameter(dbCommand, "VenderName", DbType.AnsiString, model.VenderName);
            db.AddInParameter(dbCommand, "VenderNo", DbType.AnsiString, model.VenderNo);
            db.AddInParameter(dbCommand, "VenderPhone", DbType.AnsiString, model.VenderPhone);
            db.AddInParameter(dbCommand, "VenderMobile", DbType.AnsiString, model.VenderMobile);
            db.AddInParameter(dbCommand, "BuyerCityId", DbType.Guid, model.BuyerCityId);
            db.AddInParameter(dbCommand, "BuyerCityName", DbType.AnsiString, model.BuyerCityName);
            db.AddInParameter(dbCommand, "BuyerCompanyId", DbType.Guid, model.BuyerCompanyId);
            db.AddInParameter(dbCommand, "BuyerCompanyName", DbType.AnsiString, model.BuyerCompanyName);
            db.AddInParameter(dbCommand, "BuyerDepartId", DbType.Guid, model.BuyerDepartId);
            db.AddInParameter(dbCommand, "BuyerDepartName", DbType.AnsiString, model.BuyerDepartName);
            db.AddInParameter(dbCommand, "BuyerUserId", DbType.Guid, model.BuyerUserId);
            db.AddInParameter(dbCommand, "BuyerUserName", DbType.AnsiString, model.BuyerUserName);
            db.AddInParameter(dbCommand, "BuyerId", DbType.Guid, model.BuyerId);
            db.AddInParameter(dbCommand, "BuyerName", DbType.AnsiString, model.BuyerName);
            db.AddInParameter(dbCommand, "BuyerNo", DbType.AnsiString, model.BuyerNo);
            db.AddInParameter(dbCommand, "BuyerPhone", DbType.AnsiString, model.BuyerPhone);
            db.AddInParameter(dbCommand, "BuyerMobile", DbType.AnsiString, model.BuyerMobile);
            db.AddInParameter(dbCommand, "VStandardCommision", DbType.Currency, model.VStandardCommision);
            db.AddInParameter(dbCommand, "BStandardCommision", DbType.Currency, model.BStandardCommision);
            db.AddInParameter(dbCommand, "VRealCommision", DbType.Currency, model.VRealCommision);
            db.AddInParameter(dbCommand, "BRealCommision", DbType.Currency, model.BRealCommision);
            db.AddInParameter(dbCommand, "VCommision", DbType.Currency, model.VCommision);
            db.AddInParameter(dbCommand, "BCommision", DbType.Currency, model.BCommision);
            db.AddInParameter(dbCommand, "VConsulting", DbType.Currency, model.VConsulting);
            db.AddInParameter(dbCommand, "BConsulting", DbType.Currency, model.BConsulting);
            db.AddInParameter(dbCommand, "Status", DbType.Int32, model.Status);
            db.AddInParameter(dbCommand, "CreateCityId", DbType.Guid, model.CreateCityId);
            db.AddInParameter(dbCommand, "CreateCityName", DbType.AnsiString, model.CreateCityName);
            db.AddInParameter(dbCommand, "CreateCompanyId", DbType.Guid, model.CreateCompanyId);
            db.AddInParameter(dbCommand, "CreateCompanyName", DbType.AnsiString, model.CreateCompanyName);
            db.AddInParameter(dbCommand, "CreateDepartmentId", DbType.Guid, model.CreateDepartmentId);
            db.AddInParameter(dbCommand, "CreateDepartmentName", DbType.AnsiString, model.CreateDepartmentName);
            db.AddInParameter(dbCommand, "CreateUserId", DbType.Guid, model.CreateUserId);
            db.AddInParameter(dbCommand, "CreateUserName", DbType.AnsiString, model.CreateUserName);
            db.AddInParameter(dbCommand, "CreateTime", DbType.DateTime, model.CreateTime);
            db.AddInParameter(dbCommand, "UpdateCityId", DbType.Guid, model.UpdateCityId);
            db.AddInParameter(dbCommand, "UpdateCityName", DbType.AnsiString, model.UpdateCityName);
            db.AddInParameter(dbCommand, "UpdateCompanyId", DbType.Guid, model.UpdateCompanyId);
            db.AddInParameter(dbCommand, "UpdateCompanyName", DbType.AnsiString, model.UpdateCompanyName);
            db.AddInParameter(dbCommand, "UpdateDepartmentId", DbType.Guid, model.UpdateDepartmentId);
            db.AddInParameter(dbCommand, "UpdateDepartmentName", DbType.AnsiString, model.UpdateDepartmentName);
            db.AddInParameter(dbCommand, "UpdateUserId", DbType.Guid, model.UpdateUserId);
            db.AddInParameter(dbCommand, "UpdateUserName", DbType.AnsiString, model.UpdateUserName);
            db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime);
            db.AddInParameter(dbCommand, "BusinessDescribe", DbType.AnsiString, model.BusinessDescribe);
            db.AddInParameter(dbCommand, "ApplicationDay", DbType.DateTime, model.ApplicationDay);
            db.AddInParameter(dbCommand, "DoneDay", DbType.DateTime, model.DoneDay);
            db.AddInParameter(dbCommand, "BudinessCode", DbType.AnsiString, model.BudinessCode);
            db.AddInParameter(dbCommand, "PointRemark", DbType.AnsiString, model.PointRemark);
            db.AddInParameter(dbCommand, "CompleteYear", DbType.AnsiString, model.CompleteYear);
            db.AddInParameter(dbCommand, "Fitment", DbType.AnsiString, model.Fitment);
            db.AddInParameter(dbCommand, "CustomerSource", DbType.AnsiString, model.CustomerSource);
            db.AddInParameter(dbCommand, "FixDiscount", DbType.Currency, model.FixDiscount);
            db.ExecuteNonQuery(dbCommand);

        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public static void Delete(Guid RecordId)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from t_Contract_ApplyInfo ");
            strSql.Append(" where RecordId=@RecordId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "RecordId", DbType.Guid, RecordId);
            db.ExecuteNonQuery(dbCommand);

        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static Chenxin.Lib.Business.Entity.ContractApplyInfo GetModel(Guid RecordId)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select * from t_Contract_ApplyInfo ");
            strSql.Append(" where RecordId=@RecordId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "RecordId", DbType.Guid, RecordId);
            Chenxin.Lib.Business.Entity.ContractApplyInfo model = null;
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    model = ReaderBind(dataReader);
                }
                dataReader.Close();
                dataReader.Dispose();
            }
            return model;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public static DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select RecordId,BusinessType,BargainType,BargainPrice,ConfirmType,HouseId,HouseCode,HouseAddress,HouseProperty,Area,CompleteYear,Fitment,CommunityId,Community,CommunityAddress,PropertyCode,Region,Block,CurrentFloor,TotalFloor,BuildingType,HouseUse,HouseType,BargainCityId,BargainCityName,BargainCompanyId,BargainCompanyName,BargainDepartmentId,BargainDepartmentName,BargainUserId,BargainUserName,VenderCityId,VenderCityName,VenderCompanyId,VenderCompanyName,VenderDepartId,VenderDepartName,VenderUserId,VenderUserName,VenderId,VenderName,VenderNo,VenderPhone,VenderMobile,BuyerCityId,BuyerCityName,BuyerCompanyId,BuyerCompanyName,BuyerDepartId,BuyerDepartName,BuyerUserId,BuyerUserName,BuyerId,BuyerName,BuyerNo,BuyerPhone,BuyerMobile,VStandardCommision,BStandardCommision,VRealCommision,BRealCommision,VCommision,BCommision,VConsulting,BConsulting,Status,CreateCityId,CreateCityName,CreateCompanyId,CreateCompanyName,CreateDepartmentId,CreateDepartmentName,CreateUserId,CreateUserName,CreateTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,BusinessDescribe,ApplicationDay,DoneDay,BudinessCode,PointRemark,CustomerSource,FixDiscount ");
            strSql.Append(" FROM t_Contract_ApplyInfo ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            return db.ExecuteDataSet(CommandType.Text, strSql.ToString());
        }

        /// <summary>
        /// 获得数据列表（比DataSet效率高，推荐使用）
        /// </summary>
        public static List<Chenxin.Lib.Business.Entity.ContractApplyInfo> GetListArray(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select RecordId,BusinessType,BargainType,BargainPrice,ConfirmType,HouseId,HouseCode,HouseAddress,HouseProperty,Area,CompleteYear,Fitment,CommunityId,Community,CommunityAddress,PropertyCode,Region,Block,CurrentFloor,TotalFloor,BuildingType,HouseUse,HouseType,BargainCityId,BargainCityName,BargainCompanyId,BargainCompanyName,BargainDepartmentId,BargainDepartmentName,BargainUserId,BargainUserName,VenderCityId,VenderCityName,VenderCompanyId,VenderCompanyName,VenderDepartId,VenderDepartName,VenderUserId,VenderUserName,VenderId,VenderName,VenderNo,VenderPhone,VenderMobile,BuyerCityId,BuyerCityName,BuyerCompanyId,BuyerCompanyName,BuyerDepartId,BuyerDepartName,BuyerUserId,BuyerUserName,BuyerId,BuyerName,BuyerNo,BuyerPhone,BuyerMobile,VStandardCommision,BStandardCommision,VRealCommision,BRealCommision,VCommision,BCommision,VConsulting,BConsulting,Status,CreateCityId,CreateCityName,CreateCompanyId,CreateCompanyName,CreateDepartmentId,CreateDepartmentName,CreateUserId,CreateUserName,CreateTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,BusinessDescribe,ApplicationDay,DoneDay,BudinessCode,PointRemark,CustomerSource,FixDiscount ");
            strSql.Append(" FROM t_Contract_ApplyInfo ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<Chenxin.Lib.Business.Entity.ContractApplyInfo> list = new List<Chenxin.Lib.Business.Entity.ContractApplyInfo>();
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
                while (dataReader.Read())
                {
                    list.Add(ReaderBind(dataReader));
                }
                dataReader.Close();
                dataReader.Dispose();
            }
            return list;
        }


        /// <summary>
        /// 对象实体绑定数据
        /// </summary>
        public static Chenxin.Lib.Business.Entity.ContractApplyInfo ReaderBind(IDataReader dataReader)
        {
            Chenxin.Lib.Business.Entity.ContractApplyInfo model = new Chenxin.Lib.Business.Entity.ContractApplyInfo();
            object ojb;
            ojb = dataReader["RecordId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.RecordId = new Guid(ojb.ToString());
            }
            ojb = dataReader["BusinessType"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BusinessType = (int)ojb;
            }
            ojb = dataReader["BargainType"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BargainType = (int)ojb;
            }
            ojb = dataReader["BargainPrice"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BargainPrice = (decimal)ojb;
            }
            ojb = dataReader["ConfirmType"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ConfirmType = (int)ojb;
            }
            ojb = dataReader["HouseId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.HouseId = new Guid(ojb.ToString());
            }
            model.HouseCode = dataReader["HouseCode"].ToString();
            model.HouseAddress = dataReader["HouseAddress"].ToString();
            ojb = dataReader["HouseProperty"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.HouseProperty = (int)ojb;
            }
            ojb = dataReader["Area"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Area = (decimal)ojb;
            }
            model.CompleteYear = dataReader["CompleteYear"].ToString();
            model.Fitment = dataReader["Fitment"].ToString();
            ojb = dataReader["CommunityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CommunityId = new Guid(ojb.ToString());
            }
            model.Community = dataReader["Community"].ToString();
            model.CommunityAddress = dataReader["CommunityAddress"].ToString();
            model.PropertyCode = dataReader["PropertyCode"].ToString();
            model.Region = dataReader["Region"].ToString();
            model.Block = dataReader["Block"].ToString();
            ojb = dataReader["CurrentFloor"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CurrentFloor = (int)ojb;
            }
            ojb = dataReader["TotalFloor"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.TotalFloor = (int)ojb;
            }
            model.BuildingType = dataReader["BuildingType"].ToString();
            model.HouseUse = dataReader["HouseUse"].ToString();
            model.HouseType = dataReader["HouseType"].ToString();
            ojb = dataReader["BargainCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BargainCityId = new Guid(ojb.ToString());
            }
            model.BargainCityName = dataReader["BargainCityName"].ToString();
            ojb = dataReader["BargainCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BargainCompanyId = new Guid(ojb.ToString());
            }
            model.BargainCompanyName = dataReader["BargainCompanyName"].ToString();
            ojb = dataReader["BargainDepartmentId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BargainDepartmentId = new Guid(ojb.ToString());
            }
            model.BargainDepartmentName = dataReader["BargainDepartmentName"].ToString();
            ojb = dataReader["BargainUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BargainUserId = new Guid(ojb.ToString());
            }
            model.BargainUserName = dataReader["BargainUserName"].ToString();
            ojb = dataReader["VenderCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.VenderCityId = new Guid(ojb.ToString());
            }
            model.VenderCityName = dataReader["VenderCityName"].ToString();
            ojb = dataReader["VenderCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.VenderCompanyId = new Guid(ojb.ToString());
            }
            model.VenderCompanyName = dataReader["VenderCompanyName"].ToString();
            ojb = dataReader["VenderDepartId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.VenderDepartId = new Guid(ojb.ToString());
            }
            model.VenderDepartName = dataReader["VenderDepartName"].ToString();
            ojb = dataReader["VenderUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.VenderUserId = new Guid(ojb.ToString());
            }
            model.VenderUserName = dataReader["VenderUserName"].ToString();
            ojb = dataReader["VenderId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.VenderId = new Guid(ojb.ToString());
            }
            model.VenderName = dataReader["VenderName"].ToString();
            model.VenderNo = dataReader["VenderNo"].ToString();
            model.VenderPhone = dataReader["VenderPhone"].ToString();
            model.VenderMobile = dataReader["VenderMobile"].ToString();
            ojb = dataReader["BuyerCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BuyerCityId = new Guid(ojb.ToString());
            }
            model.BuyerCityName = dataReader["BuyerCityName"].ToString();
            ojb = dataReader["BuyerCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BuyerCompanyId = new Guid(ojb.ToString());
            }
            model.BuyerCompanyName = dataReader["BuyerCompanyName"].ToString();
            ojb = dataReader["BuyerDepartId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BuyerDepartId = new Guid(ojb.ToString());
            }
            model.BuyerDepartName = dataReader["BuyerDepartName"].ToString();
            ojb = dataReader["BuyerUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BuyerUserId = new Guid(ojb.ToString());
            }
            model.BuyerUserName = dataReader["BuyerUserName"].ToString();
            ojb = dataReader["BuyerId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BuyerId = new Guid(ojb.ToString());
            }
            model.BuyerName = dataReader["BuyerName"].ToString();
            model.BuyerNo = dataReader["BuyerNo"].ToString();
            model.BuyerPhone = dataReader["BuyerPhone"].ToString();
            model.BuyerMobile = dataReader["BuyerMobile"].ToString();
            ojb = dataReader["VStandardCommision"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.VStandardCommision = (decimal)ojb;
            }
            ojb = dataReader["BStandardCommision"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BStandardCommision = (decimal)ojb;
            }
            ojb = dataReader["VRealCommision"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.VRealCommision = (decimal)ojb;
            }
            ojb = dataReader["BRealCommision"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BRealCommision = (decimal)ojb;
            }
            ojb = dataReader["VCommision"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.VCommision = (decimal)ojb;
            }
            ojb = dataReader["BCommision"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BCommision = (decimal)ojb;
            }
            ojb = dataReader["VConsulting"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.VConsulting = (decimal)ojb;
            }
            ojb = dataReader["BConsulting"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BConsulting = (decimal)ojb;
            }
            ojb = dataReader["Status"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Status = (int)ojb;
            }
            ojb = dataReader["CreateCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CreateCityId = new Guid(ojb.ToString());
            }
            model.CreateCityName = dataReader["CreateCityName"].ToString();
            ojb = dataReader["CreateCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CreateCompanyId = new Guid(ojb.ToString());
            }
            model.CreateCompanyName = dataReader["CreateCompanyName"].ToString();
            ojb = dataReader["CreateDepartmentId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CreateDepartmentId = new Guid(ojb.ToString());
            }
            model.CreateDepartmentName = dataReader["CreateDepartmentName"].ToString();
            ojb = dataReader["CreateUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CreateUserId = new Guid(ojb.ToString());
            }
            model.CreateUserName = dataReader["CreateUserName"].ToString();
            ojb = dataReader["CreateTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CreateTime = (DateTime)ojb;
            }
            ojb = dataReader["UpdateCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateCityId = new Guid(ojb.ToString());
            }
            model.UpdateCityName = dataReader["UpdateCityName"].ToString();
            ojb = dataReader["UpdateCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateCompanyId = new Guid(ojb.ToString());
            }
            model.UpdateCompanyName = dataReader["UpdateCompanyName"].ToString();
            ojb = dataReader["UpdateDepartmentId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateDepartmentId = new Guid(ojb.ToString());
            }
            model.UpdateDepartmentName = dataReader["UpdateDepartmentName"].ToString();
            ojb = dataReader["UpdateUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateUserId = new Guid(ojb.ToString());
            }
            model.UpdateUserName = dataReader["UpdateUserName"].ToString();
            ojb = dataReader["UpdateTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateTime = (DateTime)ojb;
            }
            model.BusinessDescribe = dataReader["BusinessDescribe"].ToString();
            ojb = dataReader["ApplicationDay"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ApplicationDay = (DateTime)ojb;
            }
            ojb = dataReader["DoneDay"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.DoneDay = (DateTime)ojb;
            }
            model.BudinessCode = dataReader["BudinessCode"].ToString();
            model.PointRemark = dataReader["PointRemark"].ToString();
            model.CustomerSource = dataReader["CustomerSource"].ToString();
            ojb = dataReader["FixDiscount"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.FixDiscount = (decimal)ojb;
            }
            return model;
        }


        /// <summary>
        /// 生成交易编号
        /// </summary>
        public static string GenerateCode(Guid CompanyId, int BusinessType)
        {
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            // Modified By hejifeng 100909 Start
            //DbCommand dbCommand = db.GetStoredProcCommand("usp_AutoGenerateBargainCode");
            //db.AddInParameter(dbCommand, "CompanyId", DbType.Guid, companyid);
            //db.AddInParameter(dbCommand, "Type", DbType.String, type);
            //db.AddOutParameter(dbCommand, "BargainCode", DbType.AnsiString, 150);
            DbCommand dbCommand = db.GetStoredProcCommand("usp_AutoGenerateContractCode");
            db.AddInParameter(dbCommand, "CompanyId", DbType.Guid, CompanyId);
            db.AddInParameter(dbCommand, "BusinessType", DbType.Int32, BusinessType);
            db.AddOutParameter(dbCommand, "ContractCode", DbType.AnsiString, 150);
            // Modified By hejifeng 100909 End
            db.ExecuteNonQuery(dbCommand);
            return db.GetParameterValue(dbCommand, "ContractCode").ToString();
        }

        /// <summary>
        /// 直接执行SQL语句
        /// </summary>
        /// <param name="strSql"></param>
        /// <returns></returns>
        public static DataSet ExecuteSQL(string strSql)
        {
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            return db.ExecuteDataSet(CommandType.Text, strSql);
        }

        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public static DataSet GetList(int PageIndex, int PageSize, String OrderField, string TableName, string StrWhere, string FieldList, string TableFieldList, bool DoCount)
        {
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            DbCommand dbCommand = db.GetStoredProcCommand("PagerMultiTable");
            db.AddInParameter(dbCommand, "PageIndex", DbType.Int32, PageIndex);
            db.AddInParameter(dbCommand, "PageSize", DbType.Int32, PageSize);
            db.AddInParameter(dbCommand, "OrderField", DbType.AnsiString, OrderField);
            db.AddInParameter(dbCommand, "TableName", DbType.AnsiString, TableName);
            db.AddInParameter(dbCommand, "StrWhere", DbType.AnsiString, StrWhere);
            db.AddInParameter(dbCommand, "FieldList", DbType.AnsiString, FieldList);
            db.AddInParameter(dbCommand, "TableFieldList", DbType.AnsiString, TableFieldList);
            db.AddInParameter(dbCommand, "DoCount", DbType.Boolean, DoCount);
            return db.ExecuteDataSet(dbCommand);
        }

        #endregion  成员方法
    }
}

